﻿using System.Web.Mvc;

namespace VVA.Website.UI.Areas.Admin
{
    public class AdminAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Admin";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute("Category", "Admin/{table}/Category/{action}/{id}", new { controller = "Taxonomy", action = "Index", id = UrlParameter.Optional });
            context.MapRoute("Admin_Article", "Admin/Article/{page}", new { action = "Index", controller = "Article", page = 1 }, new { page = @"(?<=\s|^)\d+(?=\s|$)" });
            context.MapRoute("Admin_Product", "Admin/Product/{page}", new { action = "Index", controller = "Product", page = 1 }, new { page = @"(?<=\s|^)\d+(?=\s|$)" });            
            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { action = "Index", controller = "Dashboard", id = UrlParameter.Optional}
            );
        }
    }
}
